<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>padding不会影响盒子大小情况</title>
    <style>
        h1 {
            height: 200px;
            background-color: pink;
            /* 没有指定weight不会撑开盒子 */
            padding: 30px;
        }

        div {
            width: 300px;
            height: 100px;
            background-color: purple;
        }

        div p {
            padding: 30px;
        }
    </style>
</head>

<body>
    <h1></h1>
    <div></div>
</body>

</html>